Added diagnostic message to exception when TypeError occurs on write.
authoremellor@ewan <emellor@ewan>
Sat, 17 Sep 2005 09:49:14 +0000 (10:49 +0100)
committeremellor@ewan <emellor@ewan>
Sat, 17 Sep 2005 09:49:14 +0000 (10:49 +0100)
tools/python/xen/xend/xenstore/xstransact.py

index 62dfc496279033b3a67ec5e122eb4dc5b6f3368d..3c56251659ea99cc2bf9c33ff0c1bc311a31f865 100644 (file)
@@ -67,7 +67,12 @@ class xstransact:
                 if not isinstance(d, dict):
                     raise TypeError
                 for key in d.keys():
-                    self._write(key, d[key], create, excl)
+                    try:
+                        self._write(key, d[key], create, excl)
+                    except TypeError, msg:
+                        raise TypeError('Writing %s: %s: %s' %
+                                        (key, str(d[key]), msg))
+                        
         elif isinstance(args[0], list):
             for l in args:
                 if not len(l) == 2: